<template>
  <w-jigsaw :big="big" :small="small" @drop="drop" @click:refresh="refresh"/>
</template>

<script>
  import $ from '../../dfish.js'

  export default {
    data() {
      return {
        big: null,
        small: null,
      }
    },
    methods: {  
      drop(e, value) {
        if (value > 50) {
          $(this).success('验证成功')
        } else {
          $(this).error('次数过多', 5000, this.refresh)
        }
      },
      refresh() {
        this.big = {src: 'http://localhost/dfish/webapp/support/auth-big.jpg', width: 480, height: 240}
        this.small = {src: 'http://localhost/dfish/webapp/support/auth-small.png', width: 91, height: 240}
      }
    },
    mounted() {
      this.big = {src: 'http://localhost/dfish/webapp/support/E621-B.png', width: 400, height: 200}
      this.small = {src: 'http://localhost/dfish/webapp/support/E621-S.png', width: 64, height: 200}
    }
  }
</script>
